<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/templates/ui.xhtml">

    <ui:define name="head">
        <style type="text/css">
            .col-label {
                width: 110px;
                text-align: right;
            }

            .col-label2 {
                /*padding-left: 80px;*/
                width: 110px;
                text-align: right;
            }

            .col-input {
                width: 180px;
            }

            .col-qry1 {
                width: 50%;
            }
        </style>
        <script language="JavaScript" type="text/JavaScript">
            document.onkeydown = function TabReplace() {
                if (event.keyCode == 13) {
                    if (event.srcElement.id != 'editForm:btnAccept') {
                        event.keyCode =9;
                    }
                }
            }
            $ = jQuery;
            $(document).ready(function() {
                $('#editForm\\:paynotescode').focus(function() {
                    $('#editForm\\:paynotescode').select();
                });
                $('#editForm\\:checkcode').focus(function() {
                    $('#editForm\\:checkcode').select();
                });
            });
        </script>
    </ui:define>

    <ui:define name="content">
        <div style="margin:5px">
            <p:growl id="msgs" showDetail="false"/>
            <h:form id="editForm">
                <p:focus for="paynotescode"/>
                <p:panel header="获取数据">
                    <h:panelGrid width="100%" cellspacing="0" border="0" columns="2" columnClasses="col-qry1">
                        <h:panelGroup>
                            <h:panelGrid cellspacing="0" border="0" columns="5">
                                <h:outputLabel value="缴款书编号:"/>
                                <h:inputText id="paynotescode" autocomplete="off" required="true"
                                             requiredMessage="请输入缴款书编号" value="#{paymentProcessAction.paynotescode}"
                                             style="width:100px"/>
                                <p:spacer width="5px"/>
                                <h:outputLabel value="校验码:"/>
                                <h:inputText id="checkcode" autocomplete="off" required="true"
                                             requiredMessage="请输入校验码" value="#{paymentProcessAction.checkcode}"
                                             style="width:100px"/>
                            </h:panelGrid>
                        </h:panelGroup>
                        <h:panelGrid cellspacing="0" border="0" columns="1">
                            <h:panelGroup>
                                <p:commandButton style="width:60px;" ajax="false"
                                                 id="btnAccept" action="#{paymentProcessAction.onBtnAccept}"
                                                 value="获 取"></p:commandButton>
                            </h:panelGroup>
                        </h:panelGrid>
                    </h:panelGrid>
                </p:panel>
                <p:ajaxStatus style="height:18px;text-align:center">
                    <f:facet name="start">
                        <h:graphicImage value="/images/ajaxloadingbar.gif"/>
                    </f:facet>
                    <f:facet name="complete">
                        <h:outputText value=""/>
                    </f:facet>
                </p:ajaxStatus>
                <p:panel>
                    <h:panelGrid id="detailPanel1" columns="1" style="width: 100%;">
                        <h:panelGrid columns="2" cellpadding="2" border="0" style="width:100%;"
                                     columnClasses="col-label">
                            <h:outputLabel value="票据编号:"/>
                            <h:inputText style="width:20%;" disabled="true" value="#{paymentProcessAction.fsPaymentinfo.notescode}"/>
                            <h:outputLabel value="缴款人:"/>
                            <h:inputText style="width:15%;" disabled="true" value="#{paymentProcessAction.fsPaymentinfo.payer}"/>
                            <h:outputLabel value="执收单位名称:"/>
                            <h:inputText style="width:30%;" disabled="true" value="#{paymentProcessAction.fsPaymentinfo.prfrmdeptname}"/>
                            <h:outputLabel value="执收单位编码:"/>
                            <h:inputText style="width:20%;" disabled="true" value="#{paymentProcessAction.fsPaymentinfo.performdept}"/>
                            <h:outputLabel value="总金额:"/>
                            <h:inputText style="width:20%;" disabled="true" value="#{paymentProcessAction.fsPaymentinfo.totalamt}">
                                <f:convertNumber pattern="###,##0.00"/>
                            </h:inputText>
                            <h:outputLabel value="验证码:"/>
                            <h:inputText style="width:15%;" disabled="true" value="#{paymentProcessAction.fsPaymentinfo.checkcode}"/>
                            <h:outputLabel value="制单人:"/>
                            <h:inputText style="width:20%;" disabled="true" value="#{paymentProcessAction.fsPaymentinfo.creater}"/>
                        </h:panelGrid>
                        <p:dataTable value="#{paymentProcessAction.fsPaymentinfoList}" var="record" id="paymenttb"
                                     emptyMessage="数据记录为空...">
                            <p:column headerText="项目编号" style="text-align:center">
                                <h:outputText value="#{record.program}"></h:outputText>
                            </p:column>
                            <p:column headerText="项目名称" style="text-align:center">
                                <h:outputText value="#{record.programname}"></h:outputText>
                            </p:column>
                            <p:column headerText="计量单位" style="text-align:center">
                                <h:outputText value="#{record.units}"></h:outputText>
                            </p:column>
                            <p:column headerText="数量" style="text-align:center">
                                <h:outputText value="#{record.amount}"></h:outputText>
                            </p:column>
                            <p:column headerText="收费标准" style="text-align:center">
                                <h:outputText value="#{record.standard}"></h:outputText>
                            </p:column>
                            <p:column headerText="金额" style="text-align:center">
                                <h:outputText value="#{record.amt}">
                                    <f:convertNumber pattern="###,##0.00"/>
                                </h:outputText>
                            </p:column>
                        </p:dataTable>
                    </h:panelGrid>
                </p:panel>
                <p:panel>
                    <h:panelGrid columns="1" cellpadding="2" border="0" style="width:100%;text-align:center;">
                        <h:panelGroup>
                            <h:commandButton id="btnPay" action="#{paymentProcessAction.onBtnPayClick}"
                                             value="确认收款"
                                             style="width:90px">
                            </h:commandButton>
                        </h:panelGroup>
                    </h:panelGrid>
                </p:panel>
            </h:form>
        </div>
    </ui:define>

</ui:composition>